#!/bin/bash

SS_EXECUTABLE=secretservice
SS_HOME=/var/services/SecretService
SS_DB=secretservice.sqlite
ADMIN_NAME=admin
ADMIN_PASSWORD=bjksafjr8jf3asbsdk4aa4
DEVICE=eth0

function start_secretservice(){
    ${SS_HOME}/${SS_EXECUTABLE} ${SS_HOME}/${SS_DB} ${ADMIN_NAME} ${ADMIN_PASSWORD} ${DEVICE}
}

function stop_secretservice(){
    killall -9 ${SECRETSERVICE_EXECUTABLE}
}

COMMAND="$1"
shift

case $COMMAND in
    start)   start_secretservice;;
    stop)    stop_secretservice;;
    restart) stop_secretservice;start_secretservice;;
esac
